package com.zm.common.constant;

/**
 * @version 1.0
 * @ ClassName ResultCode
 * 定义数据结果编码
 * @ author 王志明
 * @ Date 2020/11/11 11:53
 */
public enum ResultCode {
    /**
     * 成功状态码
     */
    SC_OK_200(200, "成功"),

    /**
     * 参数错误(1001-1999)
     */
    PARAM_IS_INVALID(1001, "参数无效"),
    PARAM_IS_BLANK(1002, "参数为空"),

    /**
     * 用户信息(2001-2999)
     */
    USER_NOT_LOGIN_IN(2001, "用户未登录,请重新登录"),
    USER_LOGIN_ERROR(2002, "账号不存在或密码错误"),
    USER_ACCOUNT_FORBIDDEN(2003, "账号已被禁用"),
    USER_NOT_EXIST(2004, "用户不存在"),
    USER_HAS_EXISTED(2005, "用户已存在"),

    /**
     * 系统出错
     */
    SC_INTERNAL_SERVER_ERROR_500(500, "系统内部出错,请联系管理员"),
    NULL_POINT_EXCEPTION(500,"空指针异常"),
    DATA_IS_EXISTED(500,"数据库中已存在该记录"),
    DATA_TOO_LONG(500,"字段太长,超出数据库字段的长度"),
    FILE_OUTOF_LIMIT(500,"文件大小超出10MB限制, 请压缩或降低文件质量!"),
    REDIS_TIME_OUT(500,"Redis 连接异常!"),

    PATH_NOT_EXISTED(404,"路径不存在，请检查路径是否正确"),

    /**
     * 其它(3001-3999)
     */

    ;

    private Integer code;
    private String message;


    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
